import request from "@/utils/request";

// 预警监控列表查询接口
export const warningListService = (queryParams) => {
    // 传递所有查询参数（包括分页和条件参数）
    return request.get('/alert/list', {
        params: queryParams  // 直接传递整个queryParams对象
    })
}

// 预警监控数据删除接口
export const warningDeleteService = (id) => {
    // 以URL参数形式传递id
    return request.delete(`/alert/delete?id=${id}`)
}

// 预警监控数据新增接口
export const warningSaveService = (data) => {
    // data格式: { area: "区域", date: "2024-01-01", warnLevel: "预警等级", algalBloom: "藻华情况", operationTime: "2024-01-01" }
    return request.post('/alert/save', data)
}
// 预警监控数据更新接口
export const warningUpdateService = (data) => {
    // data格式: { id: 1, area: "区域", date: "2024-01-01", warnLevel: "预警等级", algalBloom: "藻华情况", operationTime: "2024-01-01" }
    return request.post('/alert/update', data)
}